package com.candy.control;

import com.candy.bean.UserInfomation;
import com.candy.service.UserInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author donglin
 * @Title:
 * @类名: UserLoginController
 * @date 2020/9/25
 */
//@RestController
@RestController
@Api("用户登录管理接口")
public class UserLoginController {
    @Resource
    UserInfoService userInfoService;

    @ApiOperation("登录校验")
    @RequestMapping("logined")
    public  String logined(UserInfomation userInfomation){
//        System.out.println(userInfomation.getUsername());
//        System.out.println(userInfomation.getUserpwd());
        List<UserInfomation> infoes= userInfoService.selectforLogined(userInfomation);
        if(infoes!=null &&infoes.size()>0){
            return "ok";
        }else {
            return "eg";
        }
    }

    @RequestMapping("logined2")
    public  String logined2(String username,String userpwd){
        System.out.println(username);
        System.out.println(userpwd);
        return "logined";
    }

}
